// Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov  Date: 2010-5-13 14:07:45
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   EpBulletinDaoImpl.java

package com.stnet.dao.enterprice.dynamic;

import java.util.List;

import com.stnet.bases.BaseDaoImpl;
import com.stnet.entity.EnterpriseBulletin;

// Referenced classes of package org.stnet.dao.enterprice.dynamic:
//            EpBulletinDao

public class EpBulletinDaoImpl extends BaseDaoImpl
    implements EpBulletinDao
{

    public EpBulletinDaoImpl()
    {
    }

    public void delete(EnterpriseBulletin enterpriseBulletin)
    {
        getHibernateTemplate().delete(enterpriseBulletin);
    }

    public void delete(Long id)
    {
        getHibernateTemplate().delete(get(id));
    }

    public List findAll()
    {
        List find = getHibernateTemplate().find("from EnterpriseBulletin");
        return find;
    }

    public EnterpriseBulletin get(Long id)
    {
        return (EnterpriseBulletin)getHibernateTemplate().get(EnterpriseBulletin.class, id);
    }

    public void save(EnterpriseBulletin enterpriseBulletin)
    {
        getHibernateTemplate().save(enterpriseBulletin);
    }

    public void update(EnterpriseBulletin enterpriseBulletin)
    {
        getSessionFactory().getCurrentSession().clear();
        getHibernateTemplate().saveOrUpdate(enterpriseBulletin);
    }

    public List findAllAct()
    {
        List eb = getHibernateTemplate().find("from EnterpriseBulletin as eb where eb.state = 1  ");
        if(eb != null)
            return eb;
        else
            return null;
    }
}